<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>fdk-aac: original/libSBRdec/src/sbr_dec.cpp File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">fdk-aac
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ed137715e08969a186ec660e8ae6e2fb.html">original</a></li><li class="navelem"><a class="el" href="dir_222de58a05c98cc4a78309a37525cd28.html">libSBRdec</a></li><li class="navelem"><a class="el" href="dir_c997d48ad60fbe63e2ba342b9c79db98.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">sbr_dec.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Sbr decoder This module provides the actual decoder implementation. The SBR data (side information) is already decoded. Only three functions are provided:  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="sbr__dec_8h_source.html">sbr_dec.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="sbr__ram_8h_source.html">sbr_ram.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="env__extr_8h_source.html">env_extr.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="env__calc_8h_source.html">env_calc.h</a>&quot;</code><br />
<code>#include &quot;scale.h&quot;</code><br />
<code>#include &quot;FDK_matrixCalloc.h&quot;</code><br />
<code>#include &quot;hbe.h&quot;</code><br />
<code>#include &quot;<a class="el" href="generic_stds_8h_source.html">genericStds.h</a>&quot;</code><br />
<code>#include &quot;sbrdec_drc.h&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a0afb25e3de966d0d3d171323b93d3f94"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sbr__dec_8cpp.html#a0afb25e3de966d0d3d171323b93d3f94">sbr_dec</a> (<a class="el" href="struct_s_b_r___d_e_c.html">HANDLE_SBR_DEC</a> hSbrDec, <a class="el" href="machine__type_8h.html#adeeed35101214b62ebabd7bf71f27ab1">LONG</a> *timeIn, <a class="el" href="machine__type_8h.html#adeeed35101214b62ebabd7bf71f27ab1">LONG</a> *timeOut, <a class="el" href="struct_s_b_r___d_e_c.html">HANDLE_SBR_DEC</a> hSbrDecRight, <a class="el" href="machine__type_8h.html#adeeed35101214b62ebabd7bf71f27ab1">LONG</a> *timeOutRight, const int strideOut, <a class="el" href="struct_s_b_r___h_e_a_d_e_r___d_a_t_a.html">HANDLE_SBR_HEADER_DATA</a> hHeaderData, <a class="el" href="struct_s_b_r___f_r_a_m_e___d_a_t_a.html">HANDLE_SBR_FRAME_DATA</a> hFrameData, <a class="el" href="struct_s_b_r___p_r_e_v___f_r_a_m_e___d_a_t_a.html">HANDLE_SBR_PREV_FRAME_DATA</a> hPrevFrameData, const int applyProcessing, <a class="el" href="struct_p_s___d_e_c.html">HANDLE_PS_DEC</a> h_ps_d, const <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a> flags, const int codecFrameSize, const <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a> sbrInDataHeadroom)</td></tr>
<tr class="memdesc:a0afb25e3de966d0d3d171323b93d3f94"><td class="mdescLeft">&#160;</td><td class="mdescRight">SBR decoder core function for one channel.  <a href="sbr__dec_8cpp.html#a0afb25e3de966d0d3d171323b93d3f94">More...</a><br /></td></tr>
<tr class="separator:a0afb25e3de966d0d3d171323b93d3f94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4d2d67a25df4c2ff7016e40f7c750cb"><td class="memItemLeft" align="right" valign="top">SBR_ERROR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sbr__dec_8cpp.html#ad4d2d67a25df4c2ff7016e40f7c750cb">createSbrDec</a> (<a class="el" href="struct_s_b_r___c_h_a_n_n_e_l.html">SBR_CHANNEL</a> *hSbrChannel, <a class="el" href="struct_s_b_r___h_e_a_d_e_r___d_a_t_a.html">HANDLE_SBR_HEADER_DATA</a> hHeaderData, <a class="el" href="struct_t_r_a_n_s_p_o_s_e_r___s_e_t_t_i_n_g_s.html">TRANSPOSER_SETTINGS</a> *pSettings, const int downsampleFac, const <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a> qmfFlags, const <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a> flags, const int overlap, int chan, int codecFrameSize)</td></tr>
<tr class="memdesc:ad4d2d67a25df4c2ff7016e40f7c750cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates sbr decoder structure.  <a href="sbr__dec_8cpp.html#ad4d2d67a25df4c2ff7016e40f7c750cb">More...</a><br /></td></tr>
<tr class="separator:ad4d2d67a25df4c2ff7016e40f7c750cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14cbd2045065237640325176f7c3fd75"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sbr__dec_8cpp.html#a14cbd2045065237640325176f7c3fd75">deleteSbrDec</a> (<a class="el" href="struct_s_b_r___c_h_a_n_n_e_l.html">SBR_CHANNEL</a> *hSbrChannel)</td></tr>
<tr class="memdesc:a14cbd2045065237640325176f7c3fd75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete sbr decoder structure.  <a href="sbr__dec_8cpp.html#a14cbd2045065237640325176f7c3fd75">More...</a><br /></td></tr>
<tr class="separator:a14cbd2045065237640325176f7c3fd75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46df578151e34adf02236675b17cff86"><td class="memItemLeft" align="right" valign="top">SBR_ERROR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sbr__dec_8cpp.html#a46df578151e34adf02236675b17cff86">resetSbrDec</a> (<a class="el" href="struct_s_b_r___d_e_c.html">HANDLE_SBR_DEC</a> hSbrDec, <a class="el" href="struct_s_b_r___h_e_a_d_e_r___d_a_t_a.html">HANDLE_SBR_HEADER_DATA</a> hHeaderData, <a class="el" href="struct_s_b_r___p_r_e_v___f_r_a_m_e___d_a_t_a.html">HANDLE_SBR_PREV_FRAME_DATA</a> hPrevFrameData, const int downsampleFac, const <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a> flags, <a class="el" href="struct_s_b_r___f_r_a_m_e___d_a_t_a.html">HANDLE_SBR_FRAME_DATA</a> hFrameData)</td></tr>
<tr class="memdesc:a46df578151e34adf02236675b17cff86"><td class="mdescLeft">&#160;</td><td class="mdescRight">resets sbr decoder structure  <a href="sbr__dec_8cpp.html#a46df578151e34adf02236675b17cff86">More...</a><br /></td></tr>
<tr class="separator:a46df578151e34adf02236675b17cff86"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Sbr decoder This module provides the actual decoder implementation. The SBR data (side information) is already decoded. Only three functions are provided: </p>
<ul>
<li>1.) <a class="el" href="sbr__dec_8cpp.html#ad4d2d67a25df4c2ff7016e40f7c750cb" title="Creates sbr decoder structure.">createSbrDec()</a>: One time initialization </li>
<li>2.) <a class="el" href="sbr__dec_8cpp.html#a46df578151e34adf02236675b17cff86" title="resets sbr decoder structure">resetSbrDec()</a>: Called by sbr_Apply() when the information contained in an SBR_HEADER_ELEMENT requires a reset and recalculation of important SBR structures. </li>
<li>3.) <a class="el" href="sbr__dec_8cpp.html#a0afb25e3de966d0d3d171323b93d3f94" title="SBR decoder core function for one channel.">sbr_dec()</a>: The actual decoder. Calls the different tools such as filterbanks, <a class="el" href="lpp__tran_8cpp.html#a524aa88f1bd2cedb437ca6cde8a65cdb" title="Perform transposition by patching of subband samples. This function serves as the main entry point in...">lppTransposer()</a>, and <a class="el" href="env__calc_8cpp.html#aae9d37db2f742e05b12777329810dda8" title="Apply spectral envelope to subband samples.">calculateSbrEnvelope()</a> [the envelope adjuster].</li>
</ul>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="sbr__dec_8cpp.html#a0afb25e3de966d0d3d171323b93d3f94" title="SBR decoder core function for one channel.">sbr_dec()</a>, <a class="el" href="documentation_overview.html">Overview of important information resources and</a> </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ad4d2d67a25df4c2ff7016e40f7c750cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4d2d67a25df4c2ff7016e40f7c750cb">&#9670;&nbsp;</a></span>createSbrDec()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SBR_ERROR createSbrDec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___c_h_a_n_n_e_l.html">SBR_CHANNEL</a> *&#160;</td>
          <td class="paramname"><em>hSbrChannel</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___h_e_a_d_e_r___d_a_t_a.html">HANDLE_SBR_HEADER_DATA</a>&#160;</td>
          <td class="paramname"><em>hHeaderData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_t_r_a_n_s_p_o_s_e_r___s_e_t_t_i_n_g_s.html">TRANSPOSER_SETTINGS</a> *&#160;</td>
          <td class="paramname"><em>pSettings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>downsampleFac</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a>&#160;</td>
          <td class="paramname"><em>qmfFlags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a>&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>overlap</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>chan</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>codecFrameSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates sbr decoder structure. </p>
<dl class="section return"><dt>Returns</dt><dd>errorCode, 0 if successful </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hHeaderData</td><td>Static control data </td></tr>
    <tr><td class="paramname">downsampleFac</td><td>Downsampling factor </td></tr>
    <tr><td class="paramname">qmfFlags</td><td>flags -&gt; 1: HQ/LP selector, 2: CLDFB </td></tr>
    <tr><td class="paramname">chan</td><td>Channel for which to assign buffers etc. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a14cbd2045065237640325176f7c3fd75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14cbd2045065237640325176f7c3fd75">&#9670;&nbsp;</a></span>deleteSbrDec()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int deleteSbrDec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___c_h_a_n_n_e_l.html">SBR_CHANNEL</a> *&#160;</td>
          <td class="paramname"><em>hSbrChannel</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Delete sbr decoder structure. </p>
<dl class="section return"><dt>Returns</dt><dd>errorCode, 0 if successful </dd></dl>

</div>
</div>
<a id="a46df578151e34adf02236675b17cff86"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46df578151e34adf02236675b17cff86">&#9670;&nbsp;</a></span>resetSbrDec()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">SBR_ERROR resetSbrDec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___d_e_c.html">HANDLE_SBR_DEC</a>&#160;</td>
          <td class="paramname"><em>hSbrDec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___h_e_a_d_e_r___d_a_t_a.html">HANDLE_SBR_HEADER_DATA</a>&#160;</td>
          <td class="paramname"><em>hHeaderData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___p_r_e_v___f_r_a_m_e___d_a_t_a.html">HANDLE_SBR_PREV_FRAME_DATA</a>&#160;</td>
          <td class="paramname"><em>hPrevFrameData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>downsampleFac</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a>&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___f_r_a_m_e___d_a_t_a.html">HANDLE_SBR_FRAME_DATA</a>&#160;</td>
          <td class="paramname"><em>hFrameData</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>resets sbr decoder structure </p>
<dl class="section return"><dt>Returns</dt><dd>errorCode, 0 if successful </dd></dl>

</div>
</div>
<a id="a0afb25e3de966d0d3d171323b93d3f94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0afb25e3de966d0d3d171323b93d3f94">&#9670;&nbsp;</a></span>sbr_dec()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sbr_dec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___d_e_c.html">HANDLE_SBR_DEC</a>&#160;</td>
          <td class="paramname"><em>hSbrDec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#adeeed35101214b62ebabd7bf71f27ab1">LONG</a> *&#160;</td>
          <td class="paramname"><em>timeIn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#adeeed35101214b62ebabd7bf71f27ab1">LONG</a> *&#160;</td>
          <td class="paramname"><em>timeOut</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___d_e_c.html">HANDLE_SBR_DEC</a>&#160;</td>
          <td class="paramname"><em>hSbrDecRight</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="machine__type_8h.html#adeeed35101214b62ebabd7bf71f27ab1">LONG</a> *&#160;</td>
          <td class="paramname"><em>timeOutRight</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>strideOut</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___h_e_a_d_e_r___d_a_t_a.html">HANDLE_SBR_HEADER_DATA</a>&#160;</td>
          <td class="paramname"><em>hHeaderData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___f_r_a_m_e___d_a_t_a.html">HANDLE_SBR_FRAME_DATA</a>&#160;</td>
          <td class="paramname"><em>hFrameData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_s_b_r___p_r_e_v___f_r_a_m_e___d_a_t_a.html">HANDLE_SBR_PREV_FRAME_DATA</a>&#160;</td>
          <td class="paramname"><em>hPrevFrameData</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>applyProcessing</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_p_s___d_e_c.html">HANDLE_PS_DEC</a>&#160;</td>
          <td class="paramname"><em>h_ps_d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="machine__type_8h.html#afff0ab3629a68bc1bb3b2a2f4296173f">UINT</a>&#160;</td>
          <td class="paramname"><em>flags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>codecFrameSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="machine__type_8h.html#a4cf9af43a95c45c3d469658098dfbe1a">INT</a>&#160;</td>
          <td class="paramname"><em>sbrInDataHeadroom</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>SBR decoder core function for one channel. </p>
<div class="image">
<img src="BufferMgmtDetailed-1632.png" alt=""/>
</div>
<p>Besides the filter states of the QMF filter bank and the LPC-states of the LPP-Transposer, processing is mainly based on four buffers: #timeIn, #timeOut, #WorkBuffer2 and #OverlapBuffer. The #WorkBuffer2 is reused for all channels and might be used by the core decoder, a static overlap buffer is required for each channel. Due to in-place processing, #timeIn and #timeOut point to identical locations.</p>
<p>The spectral data is organized in so-called slots. Each slot contains 64 bands of complex data. The number of slots per frame depends on the frame size. For mp3PRO, there are 18 slots per frame and 6 slots per #OverlapBuffer. It is not necessary to have the slots in located consecutive address ranges.</p>
<p>To optimize memory usage and to minimize the number of memory accesses, the memory management is organized as follows (slot numbers based on mp3PRO):</p>
<p>1.) Input time domain signal is located in #timeIn. The last slots (0..5) of the spectral data of the previous frame are located in the #OverlapBuffer. In addition, #frameData of the current frame resides in the upper part of #timeIn.</p>
<p>2.) During the cplxAnalysisQmfFiltering(), 32 samples from #timeIn are transformed into a slot of up to 32 complex spectral low band values at a time. The first spectral slot &ndash; nr. 6 &ndash; is written at slot number zero of #WorkBuffer2. #WorkBuffer2 will be completely filled with spectral data.</p>
<p>3.) LPP-Transposition in <a class="el" href="lpp__tran_8cpp.html#a524aa88f1bd2cedb437ca6cde8a65cdb" title="Perform transposition by patching of subband samples. This function serves as the main entry point in...">lppTransposer()</a> is processed on 24 slots. During the transposition, the high band part of the spectral data is replicated based on the low band data.</p>
<p>Envelope Adjustment is processed on the high band part of the spectral data only by <a class="el" href="env__calc_8cpp.html#aae9d37db2f742e05b12777329810dda8" title="Apply spectral envelope to subband samples.">calculateSbrEnvelope()</a>.</p>
<p>4.) The cplxSynthesisQmfFiltering() creates 64 time domain samples out of a slot of 64 complex spectral values at a time. The first 6 slots in #timeOut are filled from the results of spectral slots 0..5 in the #OverlapBuffer. The consecutive slots in timeOut are now filled with the results of spectral slots 6..17.</p>
<p>5.) The preprocessed slots 18..23 have to be stored in the #OverlapBuffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hSbrDec</td><td>handle to Decoder channel </td></tr>
    <tr><td class="paramname">timeIn</td><td>pointer to input time signal </td></tr>
    <tr><td class="paramname">timeOut</td><td>pointer to output time signal </td></tr>
    <tr><td class="paramname">hSbrDecRight</td><td>handle to Decoder channel right </td></tr>
    <tr><td class="paramname">timeOutRight</td><td>pointer to output time signal </td></tr>
    <tr><td class="paramname">strideOut</td><td>Time data traversal strideOut </td></tr>
    <tr><td class="paramname">hHeaderData</td><td>Static control data </td></tr>
    <tr><td class="paramname">hFrameData</td><td>Control data of current frame </td></tr>
    <tr><td class="paramname">hPrevFrameData</td><td>Some control data of last frame </td></tr>
    <tr><td class="paramname">applyProcessing</td><td>Flag for SBR operation </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
